Incorporate PR #1031: repo-scoped suborg config resolution - #1069
Merged
Conversation
Incorporate avelizmu's repo-scoped optimization for suborgproperties and suborgteams so single-repo syncs inspect only that repo's teams/custom properties instead of enumerating every repo of every suborg org-wide. Conflict in updateRepos() resolved by keeping both the getSubOrgConfigs(repo) argument and this branch's reevaluateOnChange preMatchedSuborgSources snapshot. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Incorporates #1031 (avelizmu) into
yadhav/fix-recent-issues.What
Adds a repo-scoped fast path for suborg config resolution. When syncing a single repo (webhook events like
repo.created),getSubOrgConfigs(repo)inspects only that repo's teams and custom properties instead of enumerating every repo of every suborg org-wide. This keeps API cost flat (at most oneGET /repos/{owner}/{repo}/teamsand oneGET /repos/{owner}/{repo}/properties/values) regardless of how many suborgs/teams/properties are defined.New in
lib/settings.js:getSubOrgConfigsForRepo,repoMatchesProperties,getReposTeams,getRepoCustomPropertyValues, plusrepothreading throughloadConfigs/updateRepos/getSubOrgConfigs. Comprehensive unit tests added.Conflict resolution
One conflict in
updateRepos(): this branch'sreevaluateOnChangepreMatchedSuborgSourcessnapshot landed at the same spot as #1031'sgetSubOrgConfigs()→getSubOrgConfigs(repo)change. Resolved by keeping both.Compatibility notes
.rest.*calls align with this branch's probot 14.3.2 migration — no silent no-op risk.reloadSubOrgConfigs()stays on the org-wide path for post-apply refresh; the pre-apply snapshot uses the repo-scoped result correctly.Testing
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com